package TankCampaignGame.com.sjw.Game;

import java.util.Vector;

public class Hero extends Tank{
    Vector<BulletThread> bulletThreads = new Vector<>();
    Bullet bullet = null;
    BulletThread bulletThread = null;
    public Hero(int x, int y) {
        super(x, y);
    }

    public void shooting(){
        switch (this.getDirect()){
            case 0:
                bullet = new Bullet(getX() + 20,getY(),0);
                bulletThread = new BulletThread(bullet);
                break;
            case 1:
                bullet = new Bullet(getX() + 60,getY() + 20,1);
                bulletThread = new BulletThread(bullet);
                break;
            case 2:
                bullet = new Bullet(getX() + 20,getY() + 60,2);
                bulletThread = new BulletThread(bullet);
                break;
            case 3:
                bullet = new Bullet(getX(),getY() + 20,3);
                bulletThread = new BulletThread(bullet);
                break;
        }
        bulletThreads.add(bulletThread);
        bulletThread.start();
    }
}
